﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
                    xmlns:controlsPrimitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                    xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
                    xmlns:Converters="clr-namespace:Samples.Radio.Helpers.Converters"
                    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" xmlns:System="clr-namespace:System;assembly=mscorlib" mc:Ignorable="d">
    <!-- Colors -->
    <Color x:Key="BrandColour1">#FFE63228</Color>
    <SolidColorBrush x:Key="BrandColour1Brush"
                     Color="{StaticResource BrandColour1}" />
    <Color x:Key="BrandColour2">#FF6C6C6C</Color>
    <SolidColorBrush x:Key="BrandColour2Brush"
                     Color="{StaticResource BrandColour2}" />
    
    <!-- Image Resources -->
    <ImageSource x:Key="Logo">/Images/logo.png</ImageSource>
    <ImageSource x:Key="PanoramaBackground">/Images/disco ball background.png</ImageSource>

    <!-- Converters -->
    <Converters:EmptyStringToCollapsedConverter x:Key="EmptyStringToCollapsedConverter" />
    <Converters:CaseConverter x:Key="CaseConverter" />
    <Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />

    <!-- Data Templates -->
    <DataTemplate x:Key="EmptyPanoramaItemHeader" />

    <DataTemplate x:Key="TweetsItemTemplate">
        <Grid Margin="0,0,0,36"
              d:DesignWidth="484">
            <Grid HorizontalAlignment="Left"
                  Width="70"
                  Height="70"
                  VerticalAlignment="Top">
                <Grid.Background>
                    <SolidColorBrush Color="{StaticResource PhoneBackgroundColor}" />
                </Grid.Background>
                <Image Source="{Binding Avatar}"
                       HorizontalAlignment="Center"
                       Height="64"
                       Width="64"
                       VerticalAlignment="Center" />
            </Grid>
            <StackPanel Orientation="Vertical"
                        Margin="70,0,0,0"
                        d:LayoutOverrides="Width, Height"
                        VerticalAlignment="Top">
                <Grid VerticalAlignment="Top"
                      Margin="12,-6,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="Auto"
                                          MinWidth="77" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="{Binding TweetFrom}"
                               TextWrapping="Wrap"
                               Opacity="0.66"
                               HorizontalAlignment="Left"
                               Margin="0"
                               Style="{StaticResource PhoneTextNormalStyle}"
                               VerticalAlignment="Top" />
                    <TextBlock Text="{Binding Time}"
                               d:LayoutOverrides="Width"
                               TextWrapping="Wrap"
                               Opacity="0.66"
                               Margin="0"
                               VerticalAlignment="Top"
                               Grid.Column="1"
                               HorizontalAlignment="Right" />
                </Grid>
                <TextBlock Text="{Binding TweetText}"
                           d:LayoutOverrides="Width"
                           TextWrapping="Wrap"
                           Style="{StaticResource PhoneTextNormalStyle}"
                           Margin="12,0,0,0"
                           FontSize="{StaticResource PhoneFontSizeMedium}">
					<TextBlock.Foreground>
						<SolidColorBrush Color="{StaticResource PhoneForegroundColor}" />
					</TextBlock.Foreground>
                </TextBlock>
            </StackPanel>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="PanoTitleTemplate">
        <Grid Margin="0,30,0,0">
            <StackPanel Orientation="Horizontal"
                        Margin="0"
                        VerticalAlignment="Top"
                        HorizontalAlignment="Left">
                <Image Width="100"
                       Source="{StaticResource Logo}" />
                <StackPanel VerticalAlignment="Center">
                    <TextBlock TextWrapping="Wrap"
                               DataContext="{StaticResource StationName}"
					Text="{Binding ConverterParameter=upper, Converter={StaticResource CaseConverter}}"
                               Style="{StaticResource PhoneTextTitle1Style}"
                               Margin="12,-20,12,-18"
                               HorizontalAlignment="Left"
                               FontFamily="{StaticResource PhoneFontFamilyNormal}"
                               Foreground="{StaticResource BrandColour1Brush}"/>
                    <TextBlock TextWrapping="Wrap"
                               Text="{StaticResource Slogan}"
                               Style="{StaticResource PhoneTextTitle2Style}"
                               Foreground="{StaticResource PhoneForegroundBrush}" />
                </StackPanel>
            </StackPanel>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="PodcastsItemTemplate">
        <StackPanel>
            <Grid Margin="0,0,0,18"
                  Background="{StaticResource BrandColour1Brush}">
                <TextBlock TextWrapping="Wrap"
                           Text="{Binding Date}"
                           Style="{StaticResource PhoneTextNormalStyle}"
                           Foreground="White"
                           Margin="0,0,12,0"
                           HorizontalAlignment="Right"
                           VerticalAlignment="Top" />
                <Image Source="{Binding ProgramImage}"
                       Height="170"
                       VerticalAlignment="Top"
                       Width="170"
                       HorizontalAlignment="Left"
                       d:LayoutOverrides="Width, HorizontalMargin" />
                <Grid VerticalAlignment="Bottom"
                      Margin="0,32,0,0">
                    <Border Opacity="0.5"
                            Margin="0"
                            Background="Black" />
                    <StackPanel Margin="12,6"
                                Orientation="Vertical"
                                d:LayoutOverrides="Height">
                        <TextBlock TextWrapping="Wrap"
                                   Text="{Binding Title, ConverterParameter=upper, Converter={StaticResource CaseConverter}}"
                                   Style="{StaticResource PhoneTextTitle2Style}"
                                   Margin="0"
                                   TextAlignment="Right"
                                   Foreground="White"
                                   VerticalAlignment="Top"
                                   HorizontalAlignment="Right"
                                   FontFamily="Segoe WP" />
                        <TextBlock TextWrapping="Wrap"
                                   Text="{Binding Description}"
                                   Style="{StaticResource PhoneTextNormalStyle}"
                                   Margin="0"
                                   Foreground="#DEFFFFFF"
                                   FontSize="{StaticResource PhoneFontSizeMedium}"
                                   TextAlignment="Right" />
                    </StackPanel>
                </Grid>
                <HyperlinkButton Content="add to playlist"
                                 VerticalAlignment="Top"
                                 d:LayoutOverrides="Width"
                                 HorizontalAlignment="Right">
                    <!--<i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <ec:CallMethodAction  MethodName="AddToPlaylist"
                                                  TargetObject="{Binding}" />
                        </i:EventTrigger>
                    </i:Interaction.Triggers>-->
                </HyperlinkButton>
            </Grid>
        </StackPanel>
    </DataTemplate>
    <Style x:Key="ListBoxItemContainerStyle"
           TargetType="ListBoxItem">
    	<Setter Property="Background"
    		Value="Transparent" />
    	<Setter Property="BorderThickness"
    		Value="0" />
    	<Setter Property="BorderBrush"
    		Value="Transparent" />
    	<Setter Property="Padding"
    		Value="0" />
    	<Setter Property="HorizontalContentAlignment"
    		Value="Stretch" />
    	<Setter Property="VerticalContentAlignment"
    		Value="Top" />
    	<Setter Property="Template">
    		<Setter.Value>
    			<ControlTemplate TargetType="ListBoxItem">
    				<Border x:Name="LayoutRoot"
    					BorderBrush="{TemplateBinding BorderBrush}"
    					BorderThickness="{TemplateBinding BorderThickness}"
    					Background="{TemplateBinding Background}"
    					HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
    					VerticalAlignment="{TemplateBinding VerticalAlignment}">
    					<VisualStateManager.VisualStateGroups>
    						<VisualStateGroup x:Name="CommonStates">
    							<VisualState x:Name="Normal" />
    							<VisualState x:Name="MouseOver" />
    							<VisualState x:Name="Disabled">
    								<Storyboard>
    									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
    										Storyboard.TargetName="LayoutRoot">
    										<DiscreteObjectKeyFrame KeyTime="0"
    											Value="{StaticResource TransparentBrush}" />
    									</ObjectAnimationUsingKeyFrames>
    									<DoubleAnimation Duration="0"
    										To=".5"
    										Storyboard.TargetProperty="Opacity"
    										Storyboard.TargetName="ContentContainer" />
    								</Storyboard>
    							</VisualState>
    						</VisualStateGroup>
    						<VisualStateGroup x:Name="SelectionStates">
    							<VisualState x:Name="Unselected" />
    							<VisualState x:Name="Selected">
    								<Storyboard>
    									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
    										Storyboard.TargetName="ContentContainer">
    										<DiscreteObjectKeyFrame KeyTime="0"
    											Value="{StaticResource PhoneAccentBrush}" />
    									</ObjectAnimationUsingKeyFrames>
    								</Storyboard>
    							</VisualState>
    						</VisualStateGroup>
    					</VisualStateManager.VisualStateGroups>
    					<ContentControl x:Name="ContentContainer"
    						ContentTemplate="{TemplateBinding ContentTemplate}"
    						Content="{TemplateBinding Content}"
    						Foreground="{TemplateBinding Foreground}"
    						HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
    						Margin="{TemplateBinding Padding}"
    						VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
    				</Border>
    			</ControlTemplate>
    		</Setter.Value>
    	</Setter>
    </Style>

    <ItemsPanelTemplate x:Key="ListItemsPanelTemplate">
        <StackPanel Margin="0,0,0,36" />
    </ItemsPanelTemplate>

    <!-- Styles -->
    <Style x:Key="TransitionPageStyle"
           TargetType="phone:PhoneApplicationPage">
        <Setter Property="FontFamily"
                Value="{StaticResource PhoneFontFamilyNormal}" />
        <Setter Property="FontSize"
                Value="{StaticResource PhoneFontSizeNormal}" />
        <Setter Property="Foreground"
                Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="shell:SystemTray.ForegroundColor"
                Value="{StaticResource BrandColour1}" />
        <Setter Property="shell:SystemTray.IsVisible"
                Value="True" />
        <Setter Property="shell:SystemTray.Opacity"
                Value="0" />
        <Setter Property="SupportedOrientations"
                Value="Portrait" />
        <Setter Property="Orientation"
                Value="Portrait" />
        <Setter Property="toolkit:TransitionService.NavigationInTransition">
            <Setter.Value>
                <toolkit:NavigationInTransition>
                    <toolkit:NavigationInTransition.Backward>
                        <toolkit:TurnstileTransition Mode="BackwardIn" />
                    </toolkit:NavigationInTransition.Backward>
                    <toolkit:NavigationInTransition.Forward>
                        <toolkit:TurnstileTransition Mode="ForwardIn" />
                    </toolkit:NavigationInTransition.Forward>
                </toolkit:NavigationInTransition>
            </Setter.Value>
        </Setter>
        <Setter Property="toolkit:TransitionService.NavigationOutTransition">
            <Setter.Value>
                <toolkit:NavigationOutTransition>
                    <toolkit:NavigationOutTransition.Backward>
                        <toolkit:TurnstileTransition Mode="BackwardOut" />
                    </toolkit:NavigationOutTransition.Backward>
                    <toolkit:NavigationOutTransition.Forward>
                        <toolkit:TurnstileTransition Mode="ForwardOut" />
                    </toolkit:NavigationOutTransition.Forward>
                </toolkit:NavigationOutTransition>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="PanoTemplate"
           TargetType="controls:Panorama">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <controlsPrimitives:PanoramaPanel x:Name="panel" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground"
                Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:Panorama">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <controlsPrimitives:PanningBackgroundLayer x:Name="BackgroundLayer"
                                                                   HorizontalAlignment="Left"
                                                                   Grid.RowSpan="2">
                            <Border x:Name="background"
                                    Background="{TemplateBinding Background}"
                                    CacheMode="BitmapCache" />
                        </controlsPrimitives:PanningBackgroundLayer>
                        <controlsPrimitives:PanningTitleLayer x:Name="TitleLayer"
                                                              CacheMode="BitmapCache"
                                                              ContentTemplate="{TemplateBinding TitleTemplate}"
                                                              Content="{TemplateBinding Title}"
                                                              FontSize="187"
                                                              FontFamily="{StaticResource PhoneFontFamilyLight}"
                                                              HorizontalAlignment="Left"
                                                              Margin="24,0,0,9"
                                                              Grid.Row="0" />
                        <controlsPrimitives:PanningLayer x:Name="ItemsLayer"
                                                         HorizontalAlignment="Left"
                                                         Grid.Row="1">
                            <ItemsPresenter x:Name="items" />
                        </controlsPrimitives:PanningLayer>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="PhoneButtonBase"
           TargetType="ButtonBase">
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="BorderBrush"
                Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="Foreground"
                Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="BorderThickness"
                Value="{StaticResource PhoneBorderThickness}" />
        <Setter Property="FontFamily"
                Value="{StaticResource PhoneFontFamilySemiBold}" />
        <Setter Property="FontSize"
                Value="{StaticResource PhoneFontSizeMediumLarge}" />
        <Setter Property="Padding"
                Value="10,3,10,5" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ButtonBase">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
                                                                       Storyboard.TargetName="ContentContainer">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{StaticResource PhoneBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
                                                                       Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{StaticResource PhoneForegroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush"
                                                                       Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{StaticResource PhoneForegroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
                                                                       Storyboard.TargetName="ContentContainer">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{StaticResource PhoneDisabledBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush"
                                                                       Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{StaticResource PhoneDisabledBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
                                                                       Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="Transparent" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="ButtonBackground"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="0"
                                Margin="{StaticResource PhoneTouchTargetOverhang}">
                            <ContentControl x:Name="ContentContainer"
                                            ContentTemplate="{TemplateBinding ContentTemplate}"
                                            Content="{TemplateBinding Content}"
                                            Foreground="{TemplateBinding Foreground}"
                                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                            Padding="{TemplateBinding Padding}"
                                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="Delete This PhoneButtonStyle"
           TargetType="Button">
        <Setter Property="Background"
                Value="Transparent" />

        <Setter Property="BorderThickness"
                Value="{StaticResource PhoneBorderThickness}" />
        <Setter Property="FontFamily"
                Value="{StaticResource PhoneFontFamilySemiBold}" />
        <Setter Property="FontSize"
                Value="{StaticResource PhoneFontSizeMediumLarge}" />
        <Setter Property="Padding"
                Value="10,3,10,5" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                                                       Storyboard.TargetName="EL_Press">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                                                       Storyboard.TargetName="EL_Press">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
                                                                       Storyboard.TargetName="ContentContainer">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{StaticResource PhoneDisabledBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="Focused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <StackPanel HorizontalAlignment="Left"
                                    Margin="12"
                                    Orientation="Horizontal"
                                    d:LayoutOverrides="Height">
                            <Grid Margin="0"
                                  Width="48"
                                  Height="48">
                                <Ellipse x:Name="EL_Press"
                                         Fill="{TemplateBinding BorderBrush}"
                                         Margin="0"
                                         Height="48"
                                         StrokeThickness="3"
                                         VerticalAlignment="Center"
                                         HorizontalAlignment="Center"
                                         Width="48"
                                         Visibility="Collapsed"
                                         Stroke="Black" />
                                <Ellipse x:Name="EL_Ring"
                                         Margin="0"
                                         Height="48"
                                         StrokeThickness="3"
                                         VerticalAlignment="Center"
                                         HorizontalAlignment="Center"
                                         Width="48"
                                         Stroke="{TemplateBinding BorderBrush}" />
                            </Grid>
                            <ContentControl x:Name="ContentContainer"
                                            ContentTemplate="{TemplateBinding ContentTemplate}"
                                            Content="{TemplateBinding Content}"
                                            Foreground="{TemplateBinding Foreground}"
                                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                            Padding="{TemplateBinding Padding}"
                                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                            VerticalAlignment="Center"
                                            HorizontalAlignment="Left" />
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="PlayButtonTemplate"
           BasedOn="{StaticResource PhoneButtonBase}"
           TargetType="ToggleButton">
        <Setter Property="Padding"
                Value="12" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid Background="{TemplateBinding Background}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                                                       Storyboard.TargetName="EnabledContent">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                                                       Storyboard.TargetName="ellipse_Copy">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Unchecked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                                                       Storyboard.TargetName="rectangle">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                                                       Storyboard.TargetName="Path">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid Background="Transparent"
                              Margin="{TemplateBinding Padding}">
                            <Grid.ColumnDefinitions>
                            	<ColumnDefinition Width="Auto"
                            		MinWidth="100" />
                            	<ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Grid x:Name="GD_Button"
                                  Margin="0"
                                  HorizontalAlignment="Left" Height="100" VerticalAlignment="Center">
                                <Ellipse x:Name="ellipse_Copy"
                                         HorizontalAlignment="Left"
                                         StrokeThickness="6"
                                         Height="100"
                                         Width="100"
                                         Margin="0"
                                         Opacity="0.7"
                                         Visibility="Collapsed">
                                    <Ellipse.Fill>
                                        <SolidColorBrush Color="{StaticResource PhoneForegroundColor}" />
                                    </Ellipse.Fill>
                                    <Ellipse.Stroke>
                                        <SolidColorBrush Color="{StaticResource PhoneForegroundColor}" />
                                    </Ellipse.Stroke>
                                </Ellipse>
                                <Ellipse x:Name="ellipse"
                                         HorizontalAlignment="Left"
                                         StrokeThickness="6"
                                         Height="100"
                                         Width="100"
                                         Margin="0">
                                    <Ellipse.Stroke>
                                        <SolidColorBrush Color="{StaticResource PhoneForegroundColor}" />
                                    </Ellipse.Stroke>
                                </Ellipse>
                                <Rectangle x:Name="rectangle"
                                           StrokeThickness="6"
                                           Fill="{StaticResource PhoneForegroundBrush}"
                                           Width="40"
                                           Height="40"
                                           HorizontalAlignment="Center"
                                           VerticalAlignment="Center">
                                    <Rectangle.Stroke>
                                        <SolidColorBrush Color="{StaticResource PhoneForegroundColor}" />
                                    </Rectangle.Stroke>
                                </Rectangle>
                                <Path x:Name="Path"
                                      Height="49.104"
                                      Stretch="Fill"
                                      StrokeLineJoin="Round"
                                      Data="F1 M 69.9292,51.5546L 37.4137,75.6061L 37.4137,27.503L 69.9292,51.5546 Z "
                                      UseLayoutRounding="False"
                                      VerticalAlignment="Center"
                                      Margin="38.242,0,28.242,0">
                                    <Path.Fill>
                                        <SolidColorBrush Color="{StaticResource PhoneForegroundColor}" />
                                    </Path.Fill>
                                </Path>
                            </Grid>
                            <StackPanel Grid.Column="1"
                                        Margin="12,0,0,0"
                                        Orientation="Vertical"
                                        d:LayoutOverrides="Height"
                                        VerticalAlignment="Center">
                                <Grid x:Name="GD_Artist"
                                      VerticalAlignment="Top"
                                      Margin="0,0,0,-6"
                                      d:LayoutOverrides="Width">
                                    <ContentControl x:Name="EnabledContent1"
                                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                                    Content="{TemplateBinding Content}"
                                                    Foreground="{TemplateBinding Foreground}"
                                                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                    Margin="12,0,0,0"
                                                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                                    d:LayoutOverrides="Width"
                                                    VerticalAlignment="Center"
                                                    Visibility="Collapsed" />
                                    <ContentControl x:Name="DisabledContent1"
                                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                                    Content="{TemplateBinding Content}"
                                                    Foreground="{StaticResource PhoneDisabledBrush}"
                                                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                                    VerticalAlignment="Center"
                                                    Margin="12,0,0,0"
                                                    Visibility="Collapsed" />
                                    <TextBlock
                                               Text="{TemplateBinding Content}"
                                               d:LayoutOverrides="Height" />
                                </Grid>
                                <Grid x:Name="GD_Label"
                                      VerticalAlignment="Top"
                                      Margin="0"
                                      d:LayoutOverrides="Width">
                                    <ContentControl x:Name="EnabledContent"
                                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                                    Content="{TemplateBinding Tag}"
                                                    Foreground="{TemplateBinding Foreground}"
                                                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                    Margin="12,0,0,0"
                                                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                                    d:LayoutOverrides="Width"
                                                    VerticalAlignment="Center"
                                                    Visibility="Collapsed" />
                                    <ContentControl x:Name="DisabledContent"
                                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                                    Content="{TemplateBinding Tag}"
                                                    Foreground="{StaticResource PhoneDisabledBrush}"
                                                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                                    VerticalAlignment="Center"
                                                    Margin="12,0,0,0"
                                                    Visibility="Collapsed" />
                                    <TextBlock TextWrapping="Wrap"
                                               Text="{TemplateBinding Tag}"
                                               d:LayoutOverrides="Height"
                                               Opacity="0.7">
										<TextBlock.Foreground>
											<SolidColorBrush Color="{StaticResource PhoneForegroundColor}" />
										</TextBlock.Foreground>
                                    </TextBlock>
                                </Grid>
                            </StackPanel>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <System:Double x:Key="Podcast half width">192</System:Double>
    <Style x:Key="ProgramInfoButtonStyle"
           TargetType="Button">
    	<Setter Property="Background"
    		Value="Transparent" />
    	<Setter Property="BorderBrush"
    		Value="{x:Null}" />
    	<Setter Property="Foreground"
    		Value="{StaticResource PhoneForegroundBrush}" />
    	<Setter Property="BorderThickness"
    		Value="0" />
    	<Setter Property="FontFamily"
    		Value="{StaticResource PhoneFontFamilySemiBold}" />
    	<Setter Property="FontSize"
    		Value="{StaticResource PhoneFontSizeMediumLarge}" />
    	<Setter Property="Padding"
    		Value="{StaticResource PhoneTouchTargetOverhang}" />
    	<Setter Property="Template">
    		<Setter.Value>
    			<ControlTemplate TargetType="Button">
    				<Grid Background="Transparent"
    					VerticalAlignment="Top">
    					<VisualStateManager.VisualStateGroups>
    						<VisualStateGroup x:Name="CommonStates">
    							<VisualState x:Name="Normal" />
    							<VisualState x:Name="MouseOver" />
    							<VisualState x:Name="Pressed">
    								<Storyboard>
    									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
    										Storyboard.TargetName="ContentContainer">
    										<DiscreteObjectKeyFrame KeyTime="0"
    											Value="{StaticResource PhoneBackgroundBrush}" />
    									</ObjectAnimationUsingKeyFrames>
    									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
    										Storyboard.TargetName="ButtonBackground">
    										<DiscreteObjectKeyFrame KeyTime="0"
    											Value="{StaticResource PhoneForegroundBrush}" />
    									</ObjectAnimationUsingKeyFrames>
    									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush"
    										Storyboard.TargetName="ButtonBackground">
    										<DiscreteObjectKeyFrame KeyTime="0"
    											Value="{StaticResource PhoneForegroundBrush}" />
    									</ObjectAnimationUsingKeyFrames>
    								</Storyboard>
    							</VisualState>
    							<VisualState x:Name="Disabled">
    								<Storyboard>
    									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
    										Storyboard.TargetName="ContentContainer">
    										<DiscreteObjectKeyFrame KeyTime="0"
    											Value="{StaticResource PhoneDisabledBrush}" />
    									</ObjectAnimationUsingKeyFrames>
    									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush"
    										Storyboard.TargetName="ButtonBackground">
    										<DiscreteObjectKeyFrame KeyTime="0"
    											Value="{StaticResource PhoneDisabledBrush}" />
    									</ObjectAnimationUsingKeyFrames>
    									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
    										Storyboard.TargetName="ButtonBackground">
    										<DiscreteObjectKeyFrame KeyTime="0"
    											Value="Transparent" />
    									</ObjectAnimationUsingKeyFrames>
    								</Storyboard>
    							</VisualState>
    						</VisualStateGroup>
    					</VisualStateManager.VisualStateGroups>
    					<Border x:Name="ButtonBackground"
    						BorderBrush="{TemplateBinding BorderBrush}"
    						BorderThickness="{TemplateBinding BorderThickness}"
    						Background="{TemplateBinding Background}"
    						CornerRadius="0"
    						VerticalAlignment="Top">
    						<ContentControl x:Name="ContentContainer"
    							ContentTemplate="{TemplateBinding ContentTemplate}"
    							Content="{TemplateBinding Content}"
    							Foreground="{TemplateBinding Foreground}"
    							HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
    							VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" />
    					</Border>
    				</Grid>
    			</ControlTemplate>
    		</Setter.Value>
    	</Setter>
    	<Setter Property="HorizontalContentAlignment"
    		Value="Left" />
    </Style>
    <DataTemplate x:Key="ProgramInfoDataTemplate">
    	<StackPanel d:DesignWidth="364" >
    		<TextBlock TextWrapping="Wrap"
    			Text="{Binding ProgramName, ConverterParameter=upper, Converter={StaticResource CaseConverter}}"
    			Style="{StaticResource PhoneTextTitle3Style}"
    			Margin="0,-6,0,0"
    			FontFamily="Segoe WP"
    			FontWeight="Bold" />
    		<TextBlock TextWrapping="Wrap"
    			Text="{Binding Presenters, ConverterParameter=upper, Converter={StaticResource CaseConverter}}"
    			Style="{StaticResource PhoneTextTitle3Style}"
    			Margin="0"
    			FontFamily="Segoe WP SemiLight" />
    		<TextBlock TextWrapping="Wrap"
    			Text="{Binding ProgramSlogan}"
    			Style="{StaticResource PhoneTextNormalStyle}"
    			Opacity="0.7"
    			Margin="0" />
    	</StackPanel>
    </DataTemplate>

    <Style x:Key="RadioTemplatePanoramaStyle"
           TargetType="controls:Panorama">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <controlsPrimitives:PanoramaPanel x:Name="panel" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground"
                Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:Panorama">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <controlsPrimitives:PanningBackgroundLayer x:Name="BackgroundLayer"
                                                                   HorizontalAlignment="Left"
                                                                   Grid.RowSpan="2">
                            <Border x:Name="background"
                                    Background="{TemplateBinding Background}"
                                    CacheMode="BitmapCache">
                                <Grid Visibility="Collapsed">
                                    <Grid.Background>
                                        <RadialGradientBrush RadiusY="0.411"
                                                             RadiusX="0.778"
                                                             Center="0.483,1.048"
                                                             GradientOrigin="0.483,1.048">
                                            <GradientStop Color="Black"
                                                          Offset="0.128" />
                                            <GradientStop Color="#FFE63228"
                                                          Offset="0.064" />
                                        </RadialGradientBrush>
                                    </Grid.Background>
                                </Grid>
                            </Border>
                        </controlsPrimitives:PanningBackgroundLayer>
                        <Grid x:Name="GD_Masks"
                              Grid.RowSpan="2">
                            <Rectangle Stroke="Black"
                                       Opacity="0.5"
                                       Fill="{StaticResource PhoneBackgroundBrush}" />
                            <Rectangle Stroke="Black"
                                       Opacity="0.3"
                                       Visibility="{StaticResource PhoneLightThemeVisibility}" Fill="White"/>
                        </Grid>
                        <controlsPrimitives:PanningTitleLayer x:Name="TitleLayer"
                                                              CacheMode="BitmapCache"
                                                              ContentTemplate="{TemplateBinding TitleTemplate}"
                                                              Content="{TemplateBinding Title}"
                                                              FontSize="187"
                                                              FontFamily="{StaticResource PhoneFontFamilyLight}"
                                                              HorizontalAlignment="Left"
                                                              Margin="24,0,0,9"
                                                              Grid.Row="0" />
                        <controlsPrimitives:PanningLayer x:Name="ItemsLayer"
                                                         HorizontalAlignment="Left"
                                                         Grid.Row="1">
                            <ItemsPresenter x:Name="items" />
                        </controlsPrimitives:PanningLayer>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <DataTemplate x:Key="SettingsStreamItemTemplate">
    	<Grid Margin="0,0,0,24">
    		<StackPanel d:LayoutOverrides="Width, Height" Margin="100,-7,0,0" VerticalAlignment="Top">
    			<TextBlock Text="{Binding TrackName}" Style="{StaticResource PhoneTextNormalStyle}" FontSize="{StaticResource PhoneFontSizeMedium}"/>
    			<TextBlock Text="{Binding Artist, ConverterParameter=upper, Converter={StaticResource CaseConverter}}" Opacity="0.75" Style="{StaticResource PhoneTextNormalStyle}" FontSize="{StaticResource PhoneFontSizeMedium}"/>
    		</StackPanel>
    		<Image Source="{Binding AlbumArtUri}" HorizontalAlignment="Left" Width="100" Margin="0" VerticalAlignment="Top"/>
    	</Grid>
    </DataTemplate>
    <DataTemplate x:Key="TrackItemTemplate">
    	<Grid Margin="0,0,0,12">
    		<StackPanel d:LayoutOverrides="Width, Height"
    			Margin="75,-8,0,0"
    			VerticalAlignment="Top">
    			<TextBlock Text="{Binding TrackName}"
    				Style="{StaticResource PhoneTextNormalStyle}"
    				FontSize="{StaticResource PhoneFontSizeMedium}" />
    			<TextBlock Text="{Binding Artist, ConverterParameter=upper, Converter={StaticResource CaseConverter}}"
    				Opacity="0.75"
    				Style="{StaticResource PhoneTextNormalStyle}"
    				FontSize="{StaticResource PhoneFontSizeMedium}" />
    		</StackPanel>
    		<Image Source="{Binding TrackImageUrl}"
    			HorizontalAlignment="Left"
    			Width="75"
    			Margin="0"
    			VerticalAlignment="Top" />
    	</Grid>
    </DataTemplate>
    <System:Double x:Key="Podcast Half Height">110</System:Double>
    <Style x:Key="HalfPodcastContentControlStyle" TargetType="ContentControl">
    	<Setter Property="Template">
    		<Setter.Value>
    			<ControlTemplate TargetType="ContentControl">
    				<Grid>
    	<Grid d:DataContext="{Binding FeaturedPodcasts[0], Source={StaticResource MainPageSampleData}}" d:DesignHeight="87">
    		<Grid VerticalAlignment="Bottom" Margin="0">
    			<Border Opacity="0.5"
    				Margin="0"
    				Background="{TemplateBinding Background}"/>
    			<TextBlock TextWrapping="Wrap"
    				Text="{Binding ProgramName, ConverterParameter=upper, Converter={StaticResource CaseConverter}}"
    				d:LayoutOverrides="Height"
    				Style="{StaticResource PhoneTextNormalStyle}"
    				TextAlignment="Right"
    				HorizontalAlignment="Right"
    				Foreground="White" Margin="12,-3,12,0" />
    		</Grid>
    		<TextBlock HorizontalAlignment="Right"
    			TextWrapping="Wrap"
    			Text="{Binding PodcastAge}"
    			Style="{StaticResource PhoneTextNormalStyle}"
    			Foreground="White" Margin="{StaticResource PhoneHorizontalMargin}" d:LayoutOverrides="Height" VerticalAlignment="Top" />
    	</Grid>						
    				</Grid>
    			</ControlTemplate>
    		</Setter.Value>
    	</Setter>
    </Style>
    <Style x:Key="PodcastListBoxItemContainerStyle" TargetType="ListBoxItem">
    	<Setter Property="Background" Value="Transparent"/>
    	<Setter Property="BorderThickness" Value="0"/>
    	<Setter Property="BorderBrush" Value="Transparent"/>
    	<Setter Property="Padding" Value="0"/>
    	<Setter Property="HorizontalContentAlignment" Value="Left"/>
    	<Setter Property="VerticalContentAlignment" Value="Top"/>
    	<Setter Property="Template">
    		<Setter.Value>
    			<ControlTemplate TargetType="ListBoxItem">
    				<Border x:Name="LayoutRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Margin="0,0,12,12">
    					<VisualStateManager.VisualStateGroups>
    						<VisualStateGroup x:Name="CommonStates">
    							<VisualState x:Name="Normal"/>
    							<VisualState x:Name="MouseOver"/>
    							<VisualState x:Name="Disabled">
    								<Storyboard>
    									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="LayoutRoot">
    										<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"/>
    									</ObjectAnimationUsingKeyFrames>
    									<DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentContainer"/>
    								</Storyboard>
    							</VisualState>
    						</VisualStateGroup>
    						<VisualStateGroup x:Name="SelectionStates">
    							<VisualState x:Name="Unselected"/>
    							<VisualState x:Name="Selected">
    								<Storyboard>
    									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
    										<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneAccentBrush}"/>
    									</ObjectAnimationUsingKeyFrames>
    								</Storyboard>
    							</VisualState>
    						</VisualStateGroup>
    					</VisualStateManager.VisualStateGroups>
    					<ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
    				</Border>
    			</ControlTemplate>
    		</Setter.Value>
    	</Setter>
    </Style>
	
    <DataTemplate x:Name="FeaturedPodcastDataTemplate">
    	<Grid 
    		d:DataContext="{Binding FeaturedPodcasts[0], Source={StaticResource MainPageSampleData}}"
    		Background="{StaticResource BrandColour1Brush}" 
    		d:DesignWidth="522" d:DesignHeight="240" 
											>
    		<Image
    			HorizontalAlignment="Left" 
    			Source="{Binding ProgramImage}" VerticalAlignment="Bottom" Stretch="None" />
    		<Grid>
    			<Grid.RowDefinitions>
    				<RowDefinition Height="Auto" MinHeight="27"/>
    				<RowDefinition/>
    			</Grid.RowDefinitions>
    			<TextBlock HorizontalAlignment="Right" TextWrapping="Wrap" 
    				Text="{Binding PodcastAge}" Style="{StaticResource PhoneTextNormalStyle}"
    				Margin="12,0,12,2" d:LayoutOverrides="Height"
    				VerticalAlignment="Top"
													/>
    			<Grid Grid.Row="1" VerticalAlignment="Bottom">
    				<Border Opacity="0.5"
    					Margin="0"
    					Background="Black" />
    				<StackPanel Margin="12,0,12,12"
    					Orientation="Vertical"
    					VerticalAlignment="Bottom">
    					<TextBlock TextWrapping="Wrap"
    						Text="{Binding ProgramName, ConverterParameter=upper, Converter={StaticResource CaseConverter}}"
    						Style="{StaticResource PhoneTextExtraLargeStyle}"
    						Margin="0"
    						HorizontalAlignment="Right"
    						Foreground="#DEFFFFFF" TextAlignment="Right" 
    						FontSize="{StaticResource PhoneFontSizeLarge}" 
															/>
    					<TextBlock TextWrapping="Wrap"
    						Text="{Binding Description}"
    						Style="{StaticResource PhoneTextTitle3Style}"
    						Margin="0"
    						HorizontalAlignment="Right"
    						TextAlignment="Right"
    						Foreground="#DEFFFFFF" />
    				</StackPanel>
    			</Grid>
    		</Grid>
    	</Grid>
    </DataTemplate>
	
	<DataTemplate x:Name="PodcastTemplate0">
		<Grid 
			Height="{StaticResource Podcast Half Height}" 
			Background="{StaticResource BrandColour2Brush}" d:DesignWidth="211" 
        >
			<Image Source="{Binding ProgramImage}"
				HorizontalAlignment="Left" 
			/>
			<ContentControl Content="{Binding}"
				HorizontalContentAlignment="Stretch" 
				VerticalContentAlignment="Stretch" 
				Background="{StaticResource BrandColour1Brush}" 
				Style="{StaticResource HalfPodcastContentControlStyle}" 
			/>
		</Grid>
	</DataTemplate>
	
	<Style x:Key="CircleButtonStyle"
		TargetType="Button"
	>
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="BorderBrush"
                Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="Foreground"
                Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="BorderThickness"
                Value="{StaticResource PhoneBorderThickness}" />
        <Setter Property="FontFamily"
                Value="{StaticResource PhoneFontFamilySemiBold}" />
        <Setter Property="FontSize"
                Value="{StaticResource PhoneFontSizeMediumLarge}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
                                                                       Storyboard.TargetName="ContentArea">
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                                    Value="{StaticResource PhoneBackgroundBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames 
											Storyboard.TargetProperty="(UIElement.Visibility)" 
											Storyboard.TargetName="CirclePressed"
										>
                                        	<DiscreteObjectKeyFrame KeyTime="0">
                                        		<DiscreteObjectKeyFrame.Value>
                                        			<Visibility>Visible</Visibility>
                                        		</DiscreteObjectKeyFrame.Value>
                                        	</DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
								
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="Focused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
						
                        <Border x:Name="BackgroundBrush"
                                Background="{TemplateBinding Background}"
                                CornerRadius="0"
                                Margin="{StaticResource PhoneTouchTargetOverhang}"
						>
                            <StackPanel HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
								Orientation="Horizontal" d:LayoutOverrides="Height"
							>
                        		<Grid Height="48" HorizontalAlignment="Left">
                        			<Ellipse x:Name="CirclePressed"
                        				Width="48"
                        				Height="48" Fill="{TemplateBinding Foreground}" Visibility="Collapsed" 
									/>
                        			<Ellipse x:Name="CircleBorder"
                        				Width="48"
                        				Height="48" Stroke="{TemplateBinding Foreground}" StrokeThickness="{StaticResource PhoneStrokeThickness}" 
									/>
                        			<Grid x:Name="ContentArea"
                        				Width="48"
                        				Height="48"
                        				OpacityMask="{TemplateBinding Content}"
                        				Background="{TemplateBinding Foreground}" 
									/>
                        		</Grid>
                        		<TextBlock x:Name="TB_Label" 
									TextWrapping="Wrap" 
									Text="{TemplateBinding Tag}" 
									FontSize="{TemplateBinding FontSize}" 
									FontFamily="{TemplateBinding FontFamily}" 
									VerticalAlignment="Center" 
									Style="{StaticResource PhoneTextNormalStyle}" 
									Margin="12,0,0,0" 
									Foreground="{TemplateBinding Foreground}" 
									Visibility="{Binding Text, Converter={StaticResource EmptyStringToCollapsedConverter}, ElementName=TB_Label}"
								/>
                        	</StackPanel>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
	<System:String x:Key="Items" xml:space="preserve"> items</System:String>
	<Style x:Key="PlaylistListItemContainerStyle" TargetType="ListBoxItem">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="BorderBrush" Value="Transparent"/>
		<Setter Property="Padding" Value="0"/>
		<Setter Property="HorizontalContentAlignment" Value="Left"/>
		<Setter Property="VerticalContentAlignment" Value="Top"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ListBoxItem">
					<Border x:Name="LayoutRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Margin="0,0,0,12" d:DesignWidth="128">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="MouseOver"/>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="LayoutRoot">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentContainer"/>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
							<VisualStateGroup x:Name="SelectionStates">
								<VisualState x:Name="Unselected"/>
								<VisualState x:Name="Selected">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneAccentBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" Margin="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="Stretch"/>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>	

</ResourceDictionary>